<?php

use Illuminate\Support\Facades\Route;

// 为Admin模块定义传统路由


Route::group([
    'prefix' => 'admin', 
    'as' => 'admin.',
    'namespace' => 'Modules\Admin\Http\Controllers'
], function () {
    // 使用简短控制器名称
    Route::get('/', 'AdminController@index')->name('index');

    // 组件管理
    Route::group(['prefix' => 'components', 'as' => 'components.','namespace' => 'Components'], function () {
        Route::get('/lists', 'ListsController@index')->name('index');
    });
    
    // 权限管理
    Route::group(['prefix' => 'auth', 'as' => 'auth.', 'namespace' => 'Auth'], function () {
        // 权限管理
        Route::get('/permissions', 'PermissionController@index')->name('permissions.index');
        Route::get('/permissions/create', 'PermissionController@create')->name('permissions.create');
        Route::post('/permissions', 'PermissionController@store')->name('permissions.store');
        Route::get('/permissions/{id}/edit', 'PermissionController@edit')->name('permissions.edit');
        Route::put('/permissions/{id}', 'PermissionController@update')->name('permissions.update');
        Route::delete('/permissions/{id}', 'PermissionController@destroy')->name('permissions.destroy');
        Route::get('/permissions/list', 'PermissionController@list')->name('permissions.list');
        
        // 角色管理
        Route::get('/roles', 'RoleController@index')->name('roles.index');
        Route::get('/roles/create', 'RoleController@create')->name('roles.create');
        Route::post('/roles', 'RoleController@store')->name('roles.store');
        Route::get('/roles/{id}/edit', 'RoleController@edit')->name('roles.edit');
        Route::put('/roles/{id}', 'RoleController@update')->name('roles.update');
        Route::delete('/roles/{id}', 'RoleController@destroy')->name('roles.destroy');
        Route::get('/roles/list', 'RoleController@list')->name('roles.list');
        Route::put('/roles/{id}/status', 'RoleController@updateStatus')->name('roles.status');
    });
});
